<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html>
<HTML>
<HEAD>
<link rel="stylesheet" href="${base }/css/zTreeStyle/zTreeStyle.css" type="text/css">
			<script type="text/javascript" src="${base }/js/jquery-1.4.2.js"></script>
	<script type="text/javascript" src="${base }/js/tree/jquery.ztree.core-3.0.js"></script>
	<script type="text/javascript" src="${base }/js/tree/jquery.ztree.excheck-3.0.js"></script>
 
	<SCRIPT LANGUAGE="JavaScript">
		var setting = {
			view: {
				selectedMulti: false
			},
			check: {
				enable: true,
				chkStyle: "radio",
				radioType: "level"
			},	
			data: {
				simpleData: {
				enable: true
				}
			} ,
			async: {
				enable: true,
				url: "${base}/core/organization/tree.do?level=1"  
			}
		};
		var zNodes = ""; 
		function createTree() {
			
		}
 var treeObject;
		$(document).ready(function(){
			treeObject=$.fn.zTree.init($("#treeDemo"), setting, zNodes);	
		});
		function getSelectIds()
		{
			var nodes = treeObject.getCheckedNodes();
			for(var i=0;i<nodes.length;i++)
				{
				if(!nodes[i].isParent)
				alert(nodes[i].id );
				}

			
		}
		//-->
	</SCRIPT>
</HEAD>
 
<BODY>
<div class="content_wrap">
	<div class="zTreeDemoBackground left">
		<ul id="treeDemo" class="ztree"></ul>
	</div>
 <input type="button" value="确认" onclick="getSelectIds()">
</div>
</BODY>
</HTML>
